﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Castle.ActiveRecord;
using Castle.ActiveRecord.Framework.Config;
using WeatherModel;

namespace Weather
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            InitDataBase();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());
        }

        private static void InitDataBase()
        {
            var source = new InPlaceConfigurationSource();
            source.Add(typeof(ActiveRecordBase), AppGlobal.DataBaseConnection);
            ActiveRecordStarter.Initialize(
                new[]
                    {
                        typeof (ProSetup).Assembly,
                    },
                source);

        }
    }
}
